<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的网页导航</title>
    <style>
        :root {
            --primary: #4361ee;
            --secondary: #3a0ca3;
            --light: #f8f9fa;
            --dark: #212529;
            --accent: #4cc9f0;
            --card-bg: linear-gradient(145deg, #ffffff, #f1f3f5);
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            line-height: 1.5;
            color: var(--dark);
            background-color: var(--light);
            margin: 0;
            padding: 2rem 1rem;
        }

        header {
            text-align: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
        }

        h1 {
            color: var(--primary);
            margin: 0 0 0.5rem;
            font-size: 2.2rem;
            font-weight: 700;
        }

        .category {
            margin-bottom: 2rem;
        }

        .category-title {
            color: var(--primary);
            padding: 0.5rem 1rem;
            margin: 0 0 1rem;
            font-size: 1.3rem;
            font-weight: 600;
            border-left: 4px solid var(--accent);
            background: rgba(67, 97, 238, 0.1);
            border-radius: 0 4px 4px 0;
        }

        .grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 1rem;
        }

        .card {
            background: var(--card-bg);
            border-radius: 8px;
            padding: 1.25rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }

        .card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 3px;
            height: 100%;
            background: var(--accent);
            transition: width 0.3s ease;
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        }

        .card:hover::before {
            width: 6px;
        }

        .card h3 {
            margin: 0 0 1rem;
            color: var(--secondary);
            font-size: 1.1rem;
            font-weight: 600;
            display: flex;
            align-items: center;
        }

        .card h3::before {
            content: '→';
            margin-right: 0.5rem;
            color: var(--accent);
        }

        .card a {
            display: inline-flex;
            align-items: center;
            padding: 0.5rem 1rem;
            background: var(--primary);
            color: white;
            text-decoration: none;
            border-radius: 4px;
            font-size: 0.85rem;
            font-weight: 500;
            transition: all 0.2s ease;
        }

        .card a:hover {
            background: var(--secondary);
            transform: translateY(-2px);
        }

        @media (max-width: 768px) {
            body {
                padding: 1.5rem 0.5rem;
            }

            .grid {
                grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
                gap: 0.75rem;
            }

            .card {
                padding: 1rem;
            }
        }

        @media (max-width: 480px) {
            .grid {
                grid-template-columns: 1fr;
            }

            h1 {
                font-size: 1.8rem;
            }
        }
    </style>
</head>

<body>
    <header>
        <h1>我的网页导航</h1>
        <p>快速访问我创建的各种网页工具和游戏</p>
    </header>

    <div id="app">
        <!-- 分类内容将通过JavaScript动态生成 -->
        <p>正在加载页面列表...</p>
    </div>
    <noscript>
        <style>
            body {
                display: none !important;
            }
        </style>
        <meta http-equiv="refresh" content="0; url=about:blank">
    </noscript>
    <script src="security.js"></script>

    <script>
        // 分类配置
        const categories = {
            games: {
                title: "游戏",
                files: [
                    { path: "dadishu.html", title: "打地鼠游戏" },
                    { path: "remember.html", title: "记忆卡片" },
                    { path: "shudu.html", title: "数独游戏" },
                    { path: "guess_number.html", title: "猜数字游戏" },
                    { path: "2048.html", title: "2048游戏" }
                ]
            },
            tools: {
                title: "工具",
                files: [
                    { path: "todoList.html", title: "待办事项" },
                    { path: "calculate.html", title: "计算器" },
                    { path: "markdown.html", title: "Markdown编辑器" },
                    { path: "paint.html", title: "绘画板(电脑版)" },
                    { path: "paint_mobile.html", title: "绘画板(手机版)" }
                ]
            },
            others: {
                title: "其他",
                files: [
                    { path: "anpei.html", title: "安培定律演示" },
                    { path: "gougu.html", title: "勾股定理演示" }
                ]
            }
        };

        // 渲染分类
        function renderCategories() {
            const app = document.getElementById('app');
            app.innerHTML = '';

            for (const [key, category] of Object.entries(categories)) {
                const categoryEl = document.createElement('div');
                categoryEl.className = 'category';

                const titleEl = document.createElement('h2');
                titleEl.className = 'category-title';
                titleEl.textContent = category.title;
                categoryEl.appendChild(titleEl);

                const gridEl = document.createElement('div');
                gridEl.className = 'grid';

                // 为每个文件创建卡片
                for (const file of category.files) {
                    const cardEl = document.createElement('div');
                    cardEl.className = 'card';

                    const titleEl = document.createElement('h3');
                    titleEl.textContent = file.title;
                    cardEl.appendChild(titleEl);

                    const linkEl = document.createElement('a');
                    linkEl.href = file.path;
                    linkEl.textContent = '打开';
                    cardEl.appendChild(linkEl);

                    gridEl.appendChild(cardEl);
                }

                categoryEl.appendChild(gridEl);
                app.appendChild(categoryEl);
            }
        }

        // 初始化
        document.addEventListener('DOMContentLoaded', renderCategories);
    </script>
</body>

</html>